<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title th:text="${'提交成果物 - ' + taskApplication.applicationId}">提交成果物</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
    <div th:replace="~{fragments/header :: header}"></div>
    
    <div class="container mt-4">
        <h2>提交成果物</h2>
        
        <div class="card">
            <div class="card-body">
                <h5 class="card-title">任务信息</h5>
                <ul class="list-group list-group-flush">
                    <li class="list-group-item">
                        <strong>承接编号:</strong> 
                        <span th:text="${taskApplication.applicationId}">承接编号</span>
                    </li>
                    <li class="list-group-item">
                        <strong>任务编号:</strong> 
                        <span th:text="${taskApplication.taskId}">任务编号</span>
                    </li>
                    <li class="list-group-item">
                        <strong>承接时间:</strong> 
                        <span th:text="${#temporals.format(taskApplication.applyTime, 'yyyy-MM-dd HH:mm')}">承接时间</span>
                    </li>
                </ul>
            </div>
        </div>
        
        <!-- 附件上传表单 -->
        <div class="card mt-4">
            <div class="card-body">
                <h5 class="card-title">上传附件</h5>
                <form th:action="@{/freelancer/task-applications/{applicationId}/submit-delivery(applicationId=${taskApplication.applicationId})}" 
                      method="post" 
                      enctype="multipart/form-data">
                    <div class="mb-3">
                        <label for="attachments" class="form-label">选择文件</label>
                        <input type="file" class="form-control" id="attachments" name="attachments" multiple>
                        <div class="form-text">可以选择多个文件</div>
                    </div>
                    <button type="submit" class="btn btn-success"
                            onclick="return confirm('确定要提交成果物吗？')">提交成果物</button>
                    <a th:href="@{/freelancer/task-applications/{id}(id=${taskApplication.applicationId})}" class="btn btn-secondary">返回详情</a>
                </form>
            </div>
        </div>
    </div>
    
    <div th:replace="~{fragments/footer :: footer}"></div>
</body>
</html>